<template>
    <el-icon :size="50"><AddLocation /></el-icon>
    <div>我是console</div>
    <svg-icon></svg-icon>
</template>
<script>
import { AddLocation } from '@element-plus/icons-vue';
import { useStore } from 'vuex';

export default {
    name: "",
    setup(props) {
        // 赋值
        const store = useStore();
        console.log(store, "store的值")
        console.log(store.state.app.count);
        console.log(store.getters["app/getCount"]);
        console.log(store.state.app.text, "原始的值");
        setTimeout(() => {
            store.commit("app/SET_TEXT", "我正在学习vue3和elementPlus");
            console.log(store.state.app.text, "修改后的值");
            store.dispatch("app/update_text", "时间会验证我多爱你呀");
            console.log(store.state.app.text, "修改后的值");


        }, 5000)


        // 通过解构获取值
        const { state, getters } = useStore();
        console.log(state.app.count, "通过解构赋值拿到的");
        console.log(getters["app/getCount"]);
        console.log("原始的值", state.app.text);

        return {};
    },
    components: { AddLocation }
}
</script>
<style scoped>

</style>